# 基于最新的 php-fpm 构建
FROM php:7.2-fpm

# 安装 pdo_mysql 扩展，默认是没有的
RUN docker-php-ext-install pdo_mysql bcmath

# 更新一下 api-get, 需要通过它来安装一些必备工具
RUN apt-get clean
RUN rm -r /var/lib/apt/lists/*
RUN apt-get update

# 安装 git, zip, unzip(composer 要用到)
RUN apt-get install -y git zip unzip

# 安装 composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php composer-setup.php
RUN mv composer.phar /usr/local/bin/composer
RUN chmod +x /usr/local/bin/composer 

# 设置 composer 代理镜像
RUN composer config -g repo.packagist composer https://packagist.laravel-china.org
